package commonSources;

import java.io.Serializable;
import java.util.Hashtable;

// <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
// #[regen=yes,id=DCE.DB5E396A-9248-16C3-E18D-42763B73F2A8]
// </editor-fold> 
public class Conta implements Serializable{

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.C4BA143A-0E49-2065-B0BA-3D50F6234C38]
    // </editor-fold> 
    private String numConta;
    private Hashtable<String, Cartao> cartoes;
    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.B600D404-A778-E629-DA11-5928DFB30C7E]
    // </editor-fold> 
    private double saldo;

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.EB1BE2A3-3566-4196-12E5-A9D2EF128CC2]
    // </editor-fold> 
    public Conta(String numConta) {
        this.numConta = numConta;
        this.saldo = 0;
        cartoes = new Hashtable<String, Cartao>();
        cartoes.put(1+numConta, new Cartao(1+numConta, "0000", numConta));
    }

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,regenBody=yes,id=DCE.DB688D7F-CC2B-F5BE-B8E9-1962DBCC7D7E]
    // </editor-fold> 
    public String getNumConta() {
        return numConta;

    }

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,regenBody=yes,id=DCE.7BFC4931-217C-309B-6F0A-C7AE837726C0]
    // </editor-fold> 
    public void setNumConta(String val) {
        this.numConta = val;
    }

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,regenBody=yes,id=DCE.C9B0FDB2-E8CD-73C2-3AF9-F286965E8C95]
    // </editor-fold> 
    public double getSaldo() {
        return saldo;
    }

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,regenBody=yes,id=DCE.CD2B4C2F-25BC-6F43-20A4-75B32544AF24]
    // </editor-fold> 
    public void setSaldo(double val) {
        this.saldo = val;
    }

    /**
     * @return the cartoes
     */
    public Hashtable<String, Cartao> getCartoes() {
        return cartoes;
    }

    /**
     * @param cartoes the cartoes to set
     */
    public void setCartoes(Hashtable<String, Cartao> cartoes) {
        this.cartoes = cartoes;
    }

    public Cartao getCartao(String numCartao) {
       return cartoes.get(numCartao);
    }
}

